package cn.coder.exception;

import lombok.Getter;

/**
 * 常规阻断式的开发自行抛出的异常, 该异常被认为是正常业务逻辑, 只不过是业务失败了, 并非是系统异常了
 */
@Getter
public class BusinessException extends RuntimeException {
	protected String code;
	public BusinessException(String message) {
		super(message);
	}
	public BusinessException(String code, String message) {
		super(message);
		this.code = code;
	}
	public BusinessException(ErrorCode enumeration, String message) {
		this(enumeration.name(), message);
	}
	public BusinessException(ErrorCode enumeration) {
		this(enumeration.name(), enumeration.message());
	}
}
